package com.detect.common.exception;

import lombok.Getter;

/**
 * 采集工程全局异常
 */
@Getter
public class BusinessException extends RuntimeException {

    private final Integer code;

    public BusinessException(String message, Integer code) {
        super(message);
        this.code = code;
    }

    public <T extends BaseBusinessExceptionDesc> BusinessException(T t) {
        super(t.getMessage());
        this.code = t.getCode();
    }
}
